package cn.quevo.cube.provide.define.service.impl;

import cn.quevo.common.entity.PageResult;
import cn.quevo.cube.provide.define.dao.CubeBaseColumnDao;
import cn.quevo.cube.provide.define.entity.CubeBaseColumn;
import cn.quevo.cube.provide.define.entity.query.CubeBaseColumnQuery;
import cn.quevo.cube.provide.define.service.CubeBaseColumnService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.Map;

/**
 * 模型字段 Service接口实现
 *
 * @author July july_sky@foxmail.com
 * @version 1.0
 * @date 2018/12/11 14:51:05
 * @Copyright 东方浩星（北京）传媒科技有限公司版权所有.All Rights Reserved.
 */
@Service("cubeBaseColumnService")
@Transactional(transactionManager="transactionManager",rollbackFor={Exception.class})
public class CubeBaseColumnServiceImpl implements CubeBaseColumnService {
    @Resource(name="cubeBaseColumnDao")
    private CubeBaseColumnDao cubeBaseColumnDao;

    @Override
    public Map<String,Object> getSinge(CubeBaseColumnQuery cubeBaseColumnQuery) {
        return this.cubeBaseColumnDao.getSinge(cubeBaseColumnQuery);
    }

    @Override
    public Integer create(CubeBaseColumn cubeBaseColumn) {
        cubeBaseColumn.validateCreate();
        return this.cubeBaseColumnDao.create(cubeBaseColumn);
    }

    @Override
    public Integer update(CubeBaseColumn cubeBaseColumn) {
        cubeBaseColumn.validateUpdate();
        return this.cubeBaseColumnDao.update(cubeBaseColumn);
    }

    @Override
    public PageResult<Map<String,Object>> getPage(CubeBaseColumnQuery cubeBaseColumnQuery) {
        return this.cubeBaseColumnDao.getPage(cubeBaseColumnQuery);
    }
}
